package com.xxx.rpc.registry.zookeeper;

public class PathDataPair {

	/**
	 * 事件全路径
	 */
	private String path;

	/**
	 * 节点数据
	 */
	private String data;
	
	
	@Override
	public String toString(){
		return "{ path="+path+" , data="+data+" }";
	}

	public PathDataPair(String path){
		this.path = path;
	}
	
	public PathDataPair(String path,String data){
		this.path = path;
		this.data = data;
	}
	
	
	/**
	 * @return the data
	 */
	public String getData() {
		return data;
	}

	/**
	 * @param data
	 *            the data to set
	 */
	public void setData(String data) {
		this.data = data;
	}

	/**
	 * @return the path
	 */
	public String getPath() {
		return path;
	}

	/**
	 * @param path
	 *            the path to set
	 */
	public void setPath(String path) {
		this.path = path;
	}

	/**
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof PathDataPair)) {
			return false;
		}
		PathDataPair other = (PathDataPair) obj;
		if (path == null) {
			if (other.path != null) {
				return false;
			}
		} else if (!path.equals(other.path)) {
			return false;
		}
		return true;
	}
}
